extends Control

const CHARACTER_SELECTOR_SCENE = preload("uid://d4k8t1vj8smtj")

@export var run_startup: RunStartup

@onready var continue_btn: Button = %ContinueBtn

func _ready() -> void:
	get_tree().paused = false
	continue_btn.disabled = not SaveGame.has_save()

func _on_exit_btn_pressed() -> void:
	get_tree().quit()


func _on_new_run_btn_pressed() -> void:
	get_tree().change_scene_to_packed(CHARACTER_SELECTOR_SCENE)


func _on_continue_btn_pressed() -> void:
	run_startup.type = RunStartup.Type.CONTINUE
	get_tree().change_scene_to_file(AutoLoader.RUN_SCENE_FILE)
